//
//  SelfCenterUserHeaderTableCell.m
//  customer
//
//  Created by Holothurian on 2018/10/23.
//  Copyright © 2018年 yinlong. All rights reserved.
//

#import "SelfCenterUserHeaderTableCell.h"

@implementation SelfCenterUserHeaderTableCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        CGFloat headViewH = F_DEVICE_H * 0.18;
        CGFloat bargin = 15;
        CGFloat equalW = headViewH * 0.4;
        CGFloat topBargin = headViewH * 0.3;
        _headImgView = [[UIImageView alloc]init];
        _headImgView.contentMode = UIViewContentModeScaleAspectFill;
        
        [self.contentView addSubview:_headImgView];
        AutoWeakSelf
        [_headImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.contentView).offset(bargin);
            make.top.equalTo(weakSelf.contentView.mas_top).offset(topBargin);
            make.size.mas_equalTo(CGSizeMake(equalW, equalW));
        }];
        _headImgView.layer.cornerRadius = equalW / 2.0;
        _headImgView.layer.masksToBounds = YES;
        
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.textColor = [UIColor whiteColor];
        _nameLabel.font = Font28;
        [self.contentView addSubview:_nameLabel];
        [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.headImgView.mas_right).offset(10);
            make.right.equalTo(weakSelf.contentView.mas_right).offset(-50);
            make.top.equalTo(weakSelf.headImgView.mas_top).offset(5);
            make.height.mas_equalTo(equalW/2.0-5);
        }];
        
        _phoneLabel = [[UILabel alloc]init];
        _phoneLabel.font = Font(12);
        _phoneLabel.textColor = [UIColor whiteColor];
        [self.contentView addSubview:_phoneLabel];
        [_phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.headImgView.mas_right).offset(10);
            make.right.equalTo(weakSelf.contentView.mas_right).offset(-50);
            make.top.equalTo(weakSelf.nameLabel.mas_bottom).offset(5);
            make.height.mas_equalTo(equalW/2.0-5);
        }];
        
        UIImageView *rightImgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"WhiteRightArow"]];
        rightImgView.contentMode = UIViewContentModeScaleAspectFit;
        [self.contentView addSubview:rightImgView];
        [rightImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(weakSelf.contentView.mas_right).offset(-15);
            make.centerY.equalTo(weakSelf.contentView);
            make.size.mas_equalTo(CGSizeMake(10, 15));
        }];
        self.backgroundColor = [HSPublic colorWithHexString:@"0082DF"];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
